<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>通知管理</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	//绑定字典内容到指定的Select控件
	$(function(){
		
		/* var control = $("#Importance");
		//设置Select2的处理
		control.select2({
			allowClear : true,
			formatResult : formatResult,
			formatSelection : formatSelection,
			escapeMarkup : function(m) {
				return m;
			}
		});  */

		//绑定Ajax的内容
		$.getJSON("${pageContext.request.contextPath}/a/oa/fileNum/findElementNames", function(data) {
			var control = $("#elementCode");
			control.empty();//清空下拉框
			control.append("<option value=''>&nbsp;</option>");
			$.each(data, function(i, item) {
				control.append("<option value='" + item.elementCode + "'>&nbsp;"
						+ item.elementName + "</option>");
			});
		});
		
		$.getJSON("${pageContext.request.contextPath}/a/oa/fileNum/findFirmNames", function(data) {
			var control = $("#firmCode");
			control.empty();//清空下拉框
			control.append("<option value=''>&nbsp;</option>");
			$.each(data, function(i, item) {
				control.append("<option value='" + item.firmCode + "'>&nbsp;"
						+ item.firmName + "</option>");
			});
		});
	})
	
</script>
</head>
<body>

	<form:form id="inputForm" action="${ctx}/oa/fileNum/createRepairCode"
		method="post" class="form-horizontal">

		<div class="col-md-6">
			<div class="form-group">
				         元器件名称: 
					<select id="elementCode" name="elementCode" style="width:250px;"
						class="form-control select2" placeholder="--------请选元器件名称--------">
						<option></option>
					</select>
					厂商名称： 
					<select id="firmCode" name="firmCode" style="width:200px;"
						class="form-control select2" placeholder="------请选择厂商名称------"> 
						<option></option>
					</select>
				</div>
			</div>



		<div class="form-actions">

			<shiro:hasPermission name="oa:oaFileRepair:edit">
				<input id="btnSubmit" class="btn btn-primary" type="submit"
					value="生成编号" />&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回"
				onclick="history.go(-1)" />
				<h2>${massage}</h2>
		<h2 id="code">${code.finalNum}</h2>
		</div>
	</form:form>
		
</body>
</html>